<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:param name="pageName" value="Personal Info"></ui:param>
	<ui:define name="sidebar">
	<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	
		<h:form>
		    <h:outputText value="Travel Expense Requests (for approval)" styleClass="outputTextTitle"/>
		<p:growl />
			
			<p:tabView id="tabView" > 
				
				<p:tab id="tab1" title="Inprocess" >  
					
				  <p:dataTable value="#{approverInprocessTravelExpensesBean.travelExpenseInprocess}" var="travelExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Travel Code">
		                <h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approver Status">
		                <h:outputText value="#{travelExpense.approverStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessTravelExpensesBean.travelExpenseApprovedAction}" value="Approve" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab2" title="Approved" >  
					
				  <p:dataTable value="#{approverInprocessTravelExpensesBean.travelExpenseApprovered}" var="travelExpense" >   
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Travel Code">
		                <h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		             <p:column headerText="Approver Status">
		                <h:outputText value="#{travelExpense.approverStatus}" />
		            </p:column>
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessTravelExpensesBean.travelExpenseApprovedAction}" value="View" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab3" title="Rejected" >  
					
				  <p:dataTable value="#{approverInprocessTravelExpensesBean.travelExpenseRejected}" var="travelExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Travel Code">
		                <h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		             <p:column headerText="Approver Status">
		                <h:outputText value="#{travelExpense.approverStatus}" />
		            </p:column>
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{approverInprocessTravelExpensesBean.travelExpenseApprovedAction}" value="View" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byApprover" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
			
			</p:tabView>
			
		</h:form>
	</ui:define>
</ui:composition>

